Skip to main content

DigiLocker Verify XML File API

The following document highlights the details of the DigiLocker Verify XML File API.

API Description

Objective

The DigiLocker Verify XML File API checks whether the provided input is a valid XML file and extracts values from an Aadhaar XML file.

InputOutput
An XML file (Aadhaar XML)Extracted values from the Aadhaar XML file including name, date of birth, gender, address details, masked Aadhaar number, photo, and validation status

API URL

https://ind-verify.hyperverge.co/api/digilocker/verifyXml

API Endpoint

verifyXml

Overview

The DigiLocker Verify XML File API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadmultipart/form-data
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdOptionalA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the details of the parameters required for the DigiLocker Verify XML File API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
xmlFileMandatoryfileXML File as file typeNot ApplicableNot Applicable

Request

The following code snippet demonstrates a standard curl request for the DigiLocker Verify XML File API:

curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/verifyXml' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'xmlFile=@"<path_to_xml_file>"'

Success Responses

The following code snippets demonstrate success responses from the DigiLocker Verify XML File API:

{
"status": "success",
"statusCode": "200",
"result": {
"name": "<Name_of_the_User>",
"dob": "<Date_Of_Birth_in_DD-MM-YYYY_Format>",
"gender": "<Gender>",
"rawAddress": "<Complete_Raw_Address>",
"maskedAadhaarNumber": "<Masked_Aadhaar_Number>",
"photo": "<Base64_Image_Of_The_Users_Profile_Photo>",
"address": {
"co": "<Care_Of_Field>",
"country": "<Country>",
"district": "<District>",
"house": "<House_Number>",
"locality": "<Locality>",
"pincode": "<Pincode>",
"state": "<State>",
"street": "<Street>",
"vtc": "<Village_Town_City>",
"landmark": "<Landmark>"
},
"isValidXML": "<Boolean_Value_Indicating_If_XML_Is_Valid>"
}
}

Success Response Details

The following table outlines the details of the success response from the DigiLocker Verify XML File API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code for the response
resultobjectThe JSON object containing the extracted XML data
result.namestringThe name of the user
result.dobstringThe date of birth of the user in DD-MM-YYYY format
result.genderstringThe gender of the user
result.rawAddressstringThe complete unstructured address of the user
result.maskedAadhaarNumberstringThe masked Aadhaar number of the user
result.photostringThe base64-encoded profile photo of the user
result.addressobjectThe structured address object containing address components
result.address.costringThe name of the individual listed in the care-of field, indicating the user's parent or guardian (e.g., son of/daughter of)
result.address.countrystringThe country in the user's address
result.address.districtstringThe district in the user's address
result.address.housestringThe house number in the user's address
result.address.localitystringThe locality in the user's address
result.address.pincodestringThe postal code in the user's address
result.address.statestringThe state in the user's address
result.address.streetstringThe street in the user's address
result.address.vtcstringThe village, town, or city in the user's address
result.address.landmarkstringThe landmark in the user's address
result.isValidXMLbooleanIndicates if the XML document is valid

Error Responses

The following are some error responses from the DigiLocker Verify XML File API:

{
"status": "failure",
"statusCode": "400",
"error": {
"code": "ER_INVALID_AADHAAR_XML",
"message": "Invalid Aadhaar XML"
}
}

Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400Invalid Aadhaar XMLThe Aadhaar XML file provided is invalidPlease upload a valid Aadhaar XML file
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: